"""
URL configuration for keep_project0 project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.urls import path


from user.views import (ImageCodeView, SendSMSView, LoginView, LogoutView, UserInfoView, 
                        RefreshTokenView, DingTalkStatusCheck,
                        WeChatLogin, WeChatCallback, QQLogin, QQCallback, BindPhoneView,
                        getUserProfile, updateUserProfile, getQiniuToken, getQiniuDownloadToken, getUserProfileDetail)


urlpatterns = [
    path('imagecode/',ImageCodeView.as_view()),
    path('sendsms/',SendSMSView.as_view()),
    path('login/',LoginView.as_view()),
    path('logout/',LogoutView.as_view()),
    path('userinfo/',UserInfoView.as_view()),
    path('refresh-token/',RefreshTokenView.as_view()),

    # 钉钉回调路由 - 已迁移到工厂模式
    # path('dingdingCallback/', DingTalkCallback.as_view()),
    path('dingtalk-status/', DingTalkStatusCheck.as_view()),
    path('refresh-token/',RefreshTokenView.as_view()),

    # gitee登录路由 - 已迁移到工厂模式
    # path('gitee_auth/',GiteeAuthView.as_view()),
    # path('gitee_callback/',GiteeCallBackView.as_view()),
    # 微信登录路由
    path('wechat-login/',WeChatLogin.as_view()),
    path('wechat-callback/',WeChatCallback.as_view()),
    # QQ登录路由
    path('auth/qq/login/',QQLogin.as_view(), name='qq_login'),
    path('auth/qq/callback/', QQCallback.as_view(), name='qq_callback'),
    path('auth/bind-phone/', BindPhoneView.as_view(), name='bind_phone'),
    # path('idcard-verification/', IdCardVerificationView.as_view(), name='idcard_verification'),

    # 用户资料相关路由
    path('profile/', getUserProfile, name='get_user_profile'),
    path('profile/update/', updateUserProfile, name='update_user_profile'),
    path('profiles/<int:profile_id>/', getUserProfileDetail, name='get_user_profile_detail'),
    path('qiniu-token/', getQiniuToken, name='get_qiniu_token'),
    path('qiniu-download-token/', getQiniuDownloadToken, name='get_qiniu_download_token'),

]
